package com.sec.android.app.myfiles.shadow.android;

import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;

import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;

/**
 * Created by jaebae on 2016-07-05.
 */
@Implements(ContentResolver.class)
public class ShadowContentResolver {
    static Cursor mCursor;

    public static void setCursor(Cursor cursor) {
        mCursor = cursor;
    }

    @Implementation
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        return mCursor;
    }

    @Implementation
    public final int update(Uri uri, ContentValues values, String where, String[] selectionArgs) {
        return 0;
    }

    public final int delete(Uri url, String where, String[] selectionArgs) {
        return 0;
    }

    public final Uri insert(Uri url, ContentValues values) {
        return Uri.parse(url.toString() + "/10");
    }
}
